package com.swanclouds.redfish.managers;

import com.swanclouds.api.managers.SmtpService;
import com.swanclouds.core.transport.ClientConstants;
import com.swanclouds.model.common.ActionResponse;
import com.swanclouds.redfish.internal.BaseManagerService;
import com.swanclouds.redfish.managers.domain.SmtpServiceModel;

public class SmtpServiceImpl extends BaseManagerService implements SmtpService {

    /**
     * 查询SMT服务信息
     * @return SmtpServiceModel
     */
    @Override
    public SmtpServiceModel get() {
        return get(SmtpServiceModel.class,uri(ClientConstants.PATH_MANAGERS_SMTPSERVICE,getManagerId())).execute();
    }

    /**
     * 配置服务器SMTP服务信息
     * @return  com.swanclouds.redfish.managers.domain.SmtpServiceModel
     **/
    @Override
    public SmtpServiceModel deploy() {
        return patch(SmtpServiceModel .class, uri(ClientConstants.PATH_MANAGERS_SMTPSERVICE))/*.entity()*/.execute();
    }

    /**
     * 发送SMTP测试邮件
     * @return  com.swanclouds.model.common.ActionResponse
     **/
    @Override
    public ActionResponse sendTestMail() {
       return post(ActionResponse.class,uri(ClientConstants.PATH_MANAGERS_SMTPSERVICE_SUBMITTESTEVENT,getManagerId()))
               /* .entity()*/
                .execute();
    }
}
